/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lab2;

import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author rafael
 */
public class No {
    private String descricao;
	private int distancia;
	private Set<Aresta> arestas;

	No(String desc)
	{
		this.descricao = desc;
		this.distancia = -1;
		this.arestas = new HashSet<Aresta>();
	}
        public void setDistancia(int distancia)
        {
            this.distancia = distancia;
        }
        public int getDistancia()
        {
            return this.distancia;
        }
        public int getNumArestas()
        {
            return this.arestas.size();
        }
	public String getDescricao()
	{
		return this.descricao;
	}
	public void setDescricao(String str)
	{
		this.descricao = str;
	}
        public Set<Aresta> getArestas()
        {
            return this.arestas;
        }
        public void addConexao(No u,int peso)
        {
            this.arestas.add(new Aresta(peso,this,u));
        }
}
